const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); // 清除dist
const CssMinimizerWebpackPlugin = require("css-minimizer-webpack-plugin"); //压缩css
const BundleAnalyzerPlugin =
  require("webpack-bundle-analyzer").BundleAnalyzerPlugin; //分析压缩文件

module.exports = merge(common, {
  mode: "production",
  plugins: [new CssMinimizerWebpackPlugin(), new BundleAnalyzerPlugin()],
});
